import request from '@/utils/http'

const apiList = {
    product: 'product/list',
    addProduct: 'product/save',
    updateProduct: 'product/update',
    deleteProduct: 'product/deleteById',
    detailProduct: 'product/findById'
}

export default {
    product: data => {
        return request.post(apiList.product, data)
    },
    addProduct: data => {
        return request.post(apiList.addProduct, data)
    },
    deleteProduct: data => {
        return request.delete(apiList.deleteProduct, { params: data })
    },
    updateProduct: data => {
        return request.post(apiList.updateProduct, data)
    },
    detailProduct: data => {
        return request.get(apiList.detailProduct, { params: data })
    },
}